using System;
using System.Collections.Generic;
using System.Text;
using Directory.Model;

namespace Directory.IDAL
{
    public interface IRole
    {
		RoleInfo CreateRole(string rolename, string description, out RoleInfo.ErrorCode ErrorCode);
		void DeleteRole(string rolename, bool deleteOnlyIfRoleIsEmpty, out RoleInfo.ErrorCode ErrorCode);
		string[] GetUsersInRole(string rolename, int pageIndex, int pageSize, out int totalRecords);
		string[] GetRolesOfUser(string username, int pageIndex, int pageSize, out int totalRecords);
		string[] GetAllRoles(int pageIndex, int pageSize, out int totalRecords);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userNameStr">split with ','</param>
        /// <param name="roleNameStr">split with ','</param>
        void AddUsersToRoles(string usernameStr, string rolenameStr);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userNameStr">split with ','</param>
        /// <param name="roleNameStr">split with ','</param>
        void RemoveUsersFromRoles(string usernameStr, string rolenameStr);
		bool IsUserInRole(string username, string rolename);
    }
}
